﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using MyDMS.BusinessLayer;

public partial class AddFolder : PageBaseClass
{
    UserFolderFactory uFolderFactory;

    protected void Page_Load(object sender, EventArgs e)
    {
        uFolderFactory = new UserFolderFactory();
        List<UserFolder> uFolders = uFolderFactory.GetAllBy(UserFolder.UserFolderFields.User_Code, _author.user_Code);



    }

    protected void btnSave_Click(object sender, EventArgs e)
    {
        UserFolder uFolder = new UserFolder();
        uFolder.Folder_Name = txtFolderName.Text;
        uFolder.Folder_Desc = txtFolderDesc.Text;
        uFolder.Is_Default = false;

        uFolder.User_Code = _author.user_Code;

        uFolderFactory = new UserFolderFactory();
        if (uFolderFactory.Insert(uFolder))
        {
            lblMessage.Text = "Saved Successfully";
        }
        else
        {
            lblMessage.Text = "Error!";
        }
        lblMessage.Visible = true;
    }
}
